package iteratorapplication;


// <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
// #[regen=yes,id=DCE.5226AF07-A787-09C0-9BA8-2927FBC4D7CB]
// </editor-fold> 
public class CompteCorrent3 {

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.B297BEF9-2F3A-354B-66A5-E9F2D936C39E]
    // </editor-fold> 
    private Titular[] titulars;

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.97CE41B0-6211-2C58-867A-152607F5DA4A]
    // </editor-fold> 
    private int index;

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.E0285E60-B8CE-0A4F-EFD3-091403FD98FF]
    // </editor-fold> 
    public CompteCorrent3 () {
        titulars = new Titular[5];
        index=0;
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,regenBody=yes,id=DCE.87192B48-0B4A-A4D4-B193-1EBFD6D877B2]
    // </editor-fold> 
    public int getIndex () {
        return index;
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,regenBody=yes,id=DCE.7DBD3854-A576-FED2-DEEA-8FFEEEC9D4E9]
    // </editor-fold> 
    public void setIndex (int val) {
        this.index = val;
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,regenBody=yes,id=DCE.78A26F82-AAAC-3EE4-D005-D8E6D2AFBF09]
    // </editor-fold> 
    public Titular[] getTitulars () {
        return titulars;
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,regenBody=yes,id=DCE.FC3DF91A-CDB9-7E89-0568-A8A20A83C2D1]
    // </editor-fold> 
    public void setTitulars (Titular[] val) {
        this.titulars = val;
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.816DC093-3E70-E785-6C83-3CA0AA2196C0]
    // </editor-fold> 
    public void add (Titular titular) {
        if (index < titulars.length){
        titulars[index]=titular;
        index++;
        }
    }
public IteratorIf iterator(){

             return new IteratorIf(){
             int it=0;

             public boolean hasNext() {
               return it < index;
            }

            public Object next() {
                return titulars[it++];
            }

        };
    }
}

